package com.feihao.service.impl;

import com.feihao.dao.StudentDao;
import com.feihao.domain.Student;
import com.feihao.service.StudentService;
import com.github.pagehelper.PageInfo;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.io.Serializable;
import java.util.List;

@Service
public class StudentServiceImpl implements StudentService,Serializable {

    @Autowired
    private StudentDao studentDao;

    public PageInfo<Student> selectAll() {
        List<Student> students = studentDao.selectAll();
        PageInfo pageInfo = new PageInfo(students);
        return pageInfo;
    }

    public void addStu(Student stu) {
        studentDao.addStu(stu);
    }

    public void updateStu(Student stu) {
        studentDao.updateStu(stu);
    }

    public void deleteStu(String number) {
        studentDao.deleteStu(number);
    }
}
